package com.zhuss.controller.team;

import com.zhuss.bean.bo.team.publish.DetailPublishUserBo;
import com.zhuss.bean.bo.team.publish.SearchPublishUserBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.ReadService;
import com.zhuss.exception.WpsException;
import com.zhuss.team.publishUser.PublishUserReadServiceExt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhushanshuo
 * @Date: 2020/3/26 11:07
 */
@RestController
@RequestMapping("/publishUser")
public class PublishUserReadController extends BaseController {

    @Autowired
    @Qualifier("publishUserReadService")
    private ReadService<Object, Object> publishUserReadService;

    @Autowired
    @Qualifier("publishUserReadServiceExt")
    private PublishUserReadServiceExt publishUserReadServiceExt;

    /**
     * 列表
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/list")
    public Object list(@RequestBody SearchPublishUserBo bo) throws WpsException {
        Object result = publishUserReadService.list(bo);
        return result;
    }

    /**
     * 获取问卷问题详情
     * @param bo
     * @return
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/answerList")
    public Object answerList(@RequestBody DetailPublishUserBo bo) throws WpsException {
        Object result = publishUserReadServiceExt.answerList(bo);
        return result;
    }
}
